package jaran.poem.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class jdbcpoem2 {
    public static void main(String[] args) throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        String url="jdbc:mysql://localhost:3306/test?useSSL=false";

        String username="root";
        String password="root";
        Connection connection = DriverManager.getConnection(url, username, password);
        Statement statement = connection.createStatement();

        String t="insert into `user` (`id`,`username`,`password`) values (3,\"alice\",MD5(111))";
        int i = statement.executeUpdate(t);
        if (i>0){
            System.out.println("successful");
        }

    }
}